import request from '@/plugin/axios'


// 获取角色关联的组织节点
export function getRoleSelectedOrg(params) {
    return request({
        url: '/upms/roleorg/selected',
        method: 'get',
        params: request.adornParams(params)
    })
}

// 获取角色未关联的组织节点
export function getRoleUnSelectedOrg(params) {
    return request({
        url: '/upms/roleorg/unselected',
        method: 'get',
        params: request.adornParams(params)
    })
}

// 查询某个角色下的组织
export function getorglistbyrole(pkRole) {
    return request({
        url: '/upms/roleorg/role/' + pkRole,
        method: 'get',
        params: request.adornParams({})
    })
}

// 获取列表
export function getroleorglist(params) {
    return request({
        url: '/upms/roleorg/list',
        method: 'get',
        params: request.adornParams(params)
    })
}

// 获取信息
export function getroleorginfo(id) {
    return request({
        url: '/upms/roleorg/info/' + id,
        method: 'get',
        params: request.adornParams({})
    })
}

// 添加
export function addroleorg(data) {
    return request({
        url: '/upms/roleorg/save',
        method: 'post',
        data
    })
}

// 修改
export function updateroleorg(data) {
    return request({
        url: '/upms/roleorg/update',
        method: 'put',
        data
    })
}

// 批量删除
export function delBatchroleorg(params) {
    return request({
        url: '/upms/roleorg/delete',
        method: 'post',
        data: request.adornData(params, false)
    })
}

// 删除
export function delroleorg(id) {
    return request({
        url: '/upms/roleorg/delete/' + id,
        method: 'delete',
    })
}